package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.SysBrand;
import com.ruoyi.system.mapper.SysBrandMapper;
import com.ruoyi.system.service.SysBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysBrandServiceImpl implements SysBrandService {
    @Autowired
    SysBrandMapper mapper;
    @Override
    public List<SysBrand> queryAll(SysBrand brand) {
        return mapper.queryAll(brand);
    }

    @Override
    public int add(SysBrand brand) {
            String code=mapper.queryMaxCode();
            brand.setCode(Integer.parseInt(code)+1+"");
        return mapper.insert(brand);
    }
}
